<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>门诊结束</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/template.css" media="all">

</head>
<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
    <!-- 第一个模块开始 -->
    <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">结束门诊</div>
          <div class="layui-card-body">
          <!-- 第一个模块内容开始 -->
          
          <form action="" class="layui-form" method="post">
		<div class="layui-form-item">
			<!-- 选择疾病类型开始 -->
			<div class="layui-inline">
		    <label class="layui-form-label">疾病类型</label>
		    <div class="layui-input-inline">
		      <select name="illnessId" lay-filter="aihao" id="hobby" lay-search="">
		        <option value=""  selected="">请选择</option>
		        <option th:each="illnesse:${illnesses}" th:value="${illnesse.illnessId}">[[${illnesse.illnessName}]]</option>
		      </select>
		    </div>
		    </div>
		   
		    <!-- 选择疾病类型结束 -->
            <div class="layui-inline">
				<label class="layui-form-label">是否住院</label>
				<div class="layui-input-inline">
					<input name="isInhospital" title="是" type="radio" value="true">
					<input name="isInhospital" title="否" type="radio" value="false">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">诊断结果</label>
				<div class="layui-input-block">
					<input name="diagnose" class="layui-input" type="text"
						placeholder="诊断结果" autocomplete="off">
				</div>
			</div>
			
			<blockquote class="layui-elem-quote" style="margin:20px">请输入对诊断结果的描述</blockquote>
			<div class="">
				<textarea name="diaDesc" placeholder="请输入内容" class="layui-textarea"></textarea>
			</div>
			
			<blockquote class="layui-elem-quote" style="margin:20px">请输入患者的注意事项</blockquote>
			<div class="">
				<textarea name="note" placeholder="请输入内容" class="layui-textarea"></textarea>
			</div>
			<br/>
			<!-- 隐藏域存储门诊id -->
			<input id="outpatientId" name="outpatientId" type="hidden"/>
			<div class="layui-form-item" align="center">
				<div class="layui-input-block">
					<button class="layui-btn " type="submit" lay-filter="doSubmit" lay-submit="">结束门诊</button>
					<button class="layui-btn layui-btn-warm layui-icon layui-icon-refresh " type="reset">重置</button>
				</div>
			</div>
			
		</div>
	</form>
          <!-- 第一个模块内容结束 -->
         		
    	  </div>
    	</div>
    </div>
    <!-- 第一个模块结束 -->
    
    </div>
   </div>
          

	<script src="../../layuiadmin/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		layui.use(['element','jquery','form','table'],function(){
			var $ = layui.jquery;
			var element=layui.element;
			var form=layui.form;
			var table =layui.table;
			
			
			//表单提交
			form.on('submit(doSubmit)',function(data){
				//获得当前的门诊号
				var storeData = window.localStorage ? localStorage.getItem("localName"):Cookie.read("localName");
				//alert(storeData);
				var arrStoreData = storeData.split(",");
				var outpatientId = arrStoreData[0];
				$.ajax({
					url:'/outpatient/outpatientEnd?outpatientId='+outpatientId,
					contentType:'application/json;charset=utf-8',
					type:"post",
					data:JSON.stringify(data.field),
					success:function(res){
						alert(res);
						//清除本地门诊id与患者id的缓存
						//alert(localStorage.getItem("localName"));
						localStorage.removeItem("localName");
						//alert(localStorage.getItem("localName"));
					}
				});
			})
			
		});
	</script>
</body>
</html>